`:top
The `!Formula language`! is a `F33f`_`[scripting language`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Scripting_language]`_`f used by `F33f`_`[Lotus Notes`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Lotus_Notes]`_`f. It is often referred to as `!@Formula`! language (pronounced `*at-formula`*) because many language elements start with the @-character. Here is an example of a selection formula:
`B100`F9d9SELECT @NoteId = "NT0050D26"`f`b
>>Contents
• `F0af`_`[Development`#development]`_`f
• `F0af`_`[Structure`#structure]`_`f
• `F0af`_`[References`#references]`_`f
-─
>>Development
It was created by `F33f`_`[Ray Ozzie`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Ray_Ozzie]`_`f during the early development of Lotus Notes. He borrowed the compiler and decompiler from the `F33f`_`[Lotus 1-2-3`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Lotus_1-2-3]`_`f spreadsheet, but unlike the spreadsheet language Formula Language was designed primarily for string and list processing, not numerical processing. It was originally a `F33f`_`[Functional programming`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Functional_programming]`_`f language with unique text list-handling features inspired by Ray Ozzie's prior use of `F33f`_`[Icon`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Icon_(programming_language)]`_`f and `F33f`_`[Lisp`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Lisp_(programming_language)]`_`f.
The Formula language engine was rewritten by Damien Katz for Notes and Domino 6.`:cite-ref-1[`F5bf`_`[1`#cite-note-1]`_`f] New features were added to the language, such as looping and dynamic execution, and performance was improved.`:cite-ref-2[`F5bf`_`[2`#cite-note-2]`_`f]
>>Structure
The Formula language has two parts:
• `*@Functions`* for calculations and simple logic
• `*@Commands`* for performing actions in the user interface
`*@Functions`* can be used in several places throughout Lotus Notes. The most important uses are:
• to select documents to show to the user in a view (a kind of index) or to select documents for further processing. In this case, the formula will evaluate to a 'true' (selected) or 'false' value (not selected) for each document.
• to provide default values for fields, to transform the data entered by the user (like stripping off redundant spaces) and to validate this data.
• to get a list of values from a Notes database or even from a relational database (using `F33f`_`[ODBC`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=ODBC]`_`f). This may be used to provide a user with a list of values to choose from.
• to process a set of documents. The formula is placed in an agent, a program or macro that can be started by a user or by the Notes server according to a schedule. When the agent is triggered, the formula executes for each selected document (this a very limited form of a loop). This is an efficient way to change many documents, if the logic is not too complicated. In case of complicated changes, `F33f`_`[LotusScript`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=LotusScript]`_`f is used.
`*@Commands`* are like menu commands: they perform actions in the Lotus Notes client. Examples of actions are:
• opening a Notes database
• creating an e-mail
• putting the cursor in a specific data-entry field
• closing a window
• starting an agent
@Commands are primarily used in formulas that are triggered by user action, such as in button formulas. It is possible to combine them with @Functions, for example by making execution of an @command conditional on a field value.
>>References
`:cite-note-1`!1.`! `F0af`_`[↑`#cite-ref-1]`_`f `:citerefdamien-katz2005`aDamien Katz (January 4, 2005). "Formula Engine Rewrite". `*Personal blog`*. Retrieved September 30, 2016.
`:cite-note-2`!2.`! `F0af`_`[↑`#cite-ref-2]`_`f "Enhancements to the formula language in Domino 6". IBM. November 4, 2002. Archived from the original on October 22, 2012. Retrieved September 30, 2016.
`c`F0af`_`[↑ Back to top`#top]`_`f`a